<div>
    <?php $view->DropDownMenu()->operationControllers($view->em, $view->controller); ?>
    <a href="<?php echo $view->url(array('action' => 'addRoute'), true); ?>" class="btn btn-primary">
        Asignar ruta
    </a>
</div>
<br/>
<?php if (count($view->routes) == 0): ?>
    <div class="alert alert-info">
        Aún no han sido asignadas rutas a este controlador de operaciones.
    </div>
<?php else: ?>
    <div class="panel panel-primary">
        <div class="panel-heading">Rutas asignados activas y cerradas</div>
        <table class="table table-bordered table-condensed table-striped uppercase">
            <thead>
                <tr>
                    <th>Nombre</th>
                    <th>Acción</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($view->routes as $route): ?>
                    <tr>
                        <td><?php echo $route->getNameWithCode(); ?></td>
                        <td>
                            <form method="post" action="#">
                                <input type="hidden" name="action" value="delete"/>
                                <input type="hidden" name="route" value="<?php echo $route->getId(); ?>"/>
                                <button class="btn btn-default">Eliminar</button>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
<?php endif; ?>
